<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>社区 - 习惯掌控</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
        }

        body {
            background-color: #f6f8fa;
            color: #333;
        }

        .container {
            max-width: 414px;
            margin: 0 auto;
            background-color: white;
            min-height: 100vh;
            position: relative;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
        }

        .header {
            padding: 50px 20px 20px;
            background-color: #4CAF50;
            color: white;
        }

        .title {
            font-size: 24px;
            font-weight: bold;
        }

        .tabs {
            display: flex;
            padding: 0 15px;
            background-color: white;
            border-bottom: 1px solid #eee;
        }

        .tab {
            padding: 15px;
            color: #666;
            font-weight: 500;
            position: relative;
            cursor: pointer;
        }

        .tab.active {
            color: #4CAF50;
        }

        .tab.active:after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            height: 3px;
            background-color: #4CAF50;
            border-radius: 3px 3px 0 0;
        }

        .search-bar {
            padding: 15px;
            background-color: white;
            display: flex;
            align-items: center;
            border-bottom: 1px solid #eee;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
        }

        .search-input {
            flex: 1;
            background-color: #f2f2f2;
            border: none;
            border-radius: 20px;
            padding: 10px 15px;
            font-size: 15px;
            outline: none;
        }

        .search-icon {
            color: #999;
            padding: 0 15px 0 5px;
        }

        .community-container {
            padding: 15px;
        }

        .post {
            background-color: white;
            border-radius: 10px;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
            margin-bottom: 20px;
            overflow: hidden;
        }

        .post-header {
            padding: 15px;
            display: flex;
            align-items: center;
        }

        .post-avatar {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            background-color: #e0f2f1;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #4CAF50;
            font-weight: bold;
            font-size: 16px;
            margin-right: 10px;
        }

        .post-user {
            flex: 1;
        }

        .post-username {
            font-weight: bold;
            font-size: 15px;
        }

        .post-time {
            font-size: 12px;
            color: #999;
        }

        .post-more {
            color: #999;
            font-size: 18px;
        }

        .post-content {
            padding: 0 15px 15px;
        }

        .post-text {
            margin-bottom: 15px;
            line-height: 1.5;
            font-size: 15px;
        }

        .post-image {
            width: 100%;
            border-radius: 8px;
            margin-bottom: 15px;
            max-height: 250px;
            object-fit: cover;
        }

        .post-tags {
            display: flex;
            gap: 10px;
            margin-bottom: 15px;
            flex-wrap: wrap;
        }

        .post-tag {
            background-color: #e8f5e9;
            color: #4CAF50;
            padding: 5px 10px;
            border-radius: 20px;
            font-size: 12px;
        }

        .post-stats {
            display: flex;
            border-top: 1px solid #f5f5f5;
            padding-top: 15px;
        }

        .post-stat {
            flex: 1;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 5px;
            font-size: 14px;
            color: #666;
        }

        .post-habits {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            margin-bottom: 15px;
        }

        .post-habit {
            display: flex;
            align-items: center;
            background-color: #f1f8e9;
            padding: 5px 10px;
            border-radius: 20px;
            font-size: 12px;
            color: #4CAF50;
        }

        .post-habit i {
            margin-right: 5px;
        }

        .challenge {
            background-color: white;
            border-radius: 10px;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
            padding: 15px;
            margin-bottom: 20px;
        }

        .challenge-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 15px;
        }

        .challenge-title {
            font-weight: bold;
            font-size: 16px;
            color: #4CAF50;
        }

        .challenge-action {
            color: #4CAF50;
            font-size: 14px;
            font-weight: bold;
        }

        .challenge-list {
            display: flex;
            gap: 15px;
            overflow-x: auto;
            padding-bottom: 10px;
        }

        .challenge-card {
            min-width: 200px;
            height: 120px;
            border-radius: 10px;
            padding: 15px;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            background-color: #e8f5e9;
            border: 1px solid #c8e6c9;
        }

        .challenge-card-title {
            font-weight: bold;
            color: #2E7D32;
        }

        .challenge-card-stats {
            display: flex;
            justify-content: space-between;
            font-size: 13px;
            color: #4CAF50;
        }

        .challenge-card-footer {
            display: flex;
            align-items: center;
            gap: 5px;
            font-size: 12px;
            color: #666;
        }

        .challenge-card-avatars {
            display: flex;
        }

        .challenge-card-avatar {
            width: 20px;
            height: 20px;
            border-radius: 50%;
            background-color: #4CAF50;
            color: white;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 10px;
            border: 1px solid white;
            margin-right: -8px;
        }

        .navigation {
            position: fixed;
            bottom: 0;
            width: 100%;
            max-width: 414px;
            background-color: white;
            display: flex;
            justify-content: space-around;
            padding: 15px 0;
            border-top: 1px solid #e0e0e0;
        }

        .nav-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            font-size: 12px;
            color: #888;
        }

        .nav-item.active {
            color: #4CAF50;
        }

        .nav-icon {
            font-size: 20px;
            margin-bottom: 5px;
        }

        .add-button {
            position: absolute;
            bottom: 70px;
            right: 20px;
            width: 56px;
            height: 56px;
            background-color: #4CAF50;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 24px;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
        }

        .empty-space {
            height: 80px;
        }
    </style>
</head>

<body>
    <div class="container">
        <div class="header">
            <div class="title">习惯社区</div>
        </div>

        <div class="tabs">
            <div class="tab active">推荐</div>
            <div class="tab">关注</div>
            <div class="tab">挑战</div>
            <div class="tab">最新</div>
        </div>

        <div class="search-bar">
            <input type="text" placeholder="搜索" class="search-input">
            <div class="search-icon">
                <i class="fas fa-search"></i>
            </div>
        </div>

        <div class="community-container">
            <div class="challenge">
                <div class="challenge-header">
                    <div class="challenge-title">热门挑战</div>
                    <div class="challenge-action">查看全部</div>
                </div>
                <div class="challenge-list">
                    <div class="challenge-card">
                        <div class="challenge-card-title">30天早起挑战</div>
                        <div class="challenge-card-stats">
                            <div>1254人参与</div>
                            <div>进行中</div>
                        </div>
                        <div class="challenge-card-footer">
                            <div class="challenge-card-avatars">
                                <div class="challenge-card-avatar">L</div>
                                <div class="challenge-card-avatar">M</div>
                                <div class="challenge-card-avatar">S</div>
                            </div>
                            <div>+1251人</div>
                        </div>
                    </div>
                    <div class="challenge-card">
                        <div class="challenge-card-title">21天读书计划</div>
                        <div class="challenge-card-stats">
                            <div>982人参与</div>
                            <div>进行中</div>
                        </div>
                        <div class="challenge-card-footer">
                            <div class="challenge-card-avatars">
                                <div class="challenge-card-avatar">W</div>
                                <div class="challenge-card-avatar">Z</div>
                                <div class="challenge-card-avatar">T</div>
                            </div>
                            <div>+979人</div>
                        </div>
                    </div>
                </div>
            </div>

            <div class="post">
                <div class="post-header">
                    <div class="post-avatar">L</div>
                    <div class="post-user">
                        <div class="post-username">林晓明</div>
                        <div class="post-time">2小时前</div>
                    </div>
                    <div class="post-more">
                        <i class="fas fa-ellipsis-h"></i>
                    </div>
                </div>
                <div class="post-content">
                    <div class="post-text">坚持跑步第100天！从最初的坚持不下来到现在的习惯性出门跑步，感谢《掌控习惯》这本书让我明白了习惯养成的本质。分享一下我的晨跑照片，希望能激励到大家！
                    </div>
                    <img src="https://images.unsplash.com/photo-1461896836934-ffe607ba8211?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1170&q=80"
                        class="post-image">
                    <div class="post-habits">
                        <div class="post-habit"><i class="fas fa-running"></i> 晨跑5公里</div>
                    </div>
                    <div class="post-tags">
                        <div class="post-tag">跑步</div>
                        <div class="post-tag">坚持100天</div>
                        <div class="post-tag">早起</div>
                    </div>
                    <div class="post-stats">
                        <div class="post-stat">
                            <i class="far fa-heart"></i> 245
                        </div>
                        <div class="post-stat">
                            <i class="far fa-comment"></i> 56
                        </div>
                        <div class="post-stat">
                            <i class="far fa-bookmark"></i> 收藏
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div class="navigation">
            <div class="nav-item">
                <div class="nav-icon"><i class="fas fa-home"></i></div>
                <div>首页</div>
            </div>
            <div class="nav-item">
                <div class="nav-icon"><i class="fas fa-list-check"></i></div>
                <div>习惯</div>
            </div>
            <div class="nav-item active">
                <div class="nav-icon"><i class="fas fa-users"></i></div>
                <div>社区</div>
            </div>
            <div class="nav-item">
                <div class="nav-icon"><i class="fas fa-user"></i></div>
                <div>我的</div>
            </div>
        </div>
    </div>
</body>

</html>